package com.cn.enumeration.gpt;

public class Demo1 {
    public static void main(String[] args) {
        Color red = Color.RED;
        System.out.println("My color is "+ red);
        System.out.println(red.name());
        System.out.println(red.ordinal());
        Color2 red1 = Color2.RED;
    }
}


//定义枚举类 public enum Color
enum Color{
    RED,GREEN,BLUE;
}